<?
/*换头设置
 *
 *
*/
$httphost = $_SERVER['HTTP_HOST'];



$default='dev.12301.cc';
$h_config=array();
$h_config[$default]['name']='票付通';
$h_config[$default]['logo']='/images/index_logo.png';
$h_config[$default]['navi']=1;
$h_config[$default]['tel']='400-99-22301';
$h_config[$default]['addr']='<span>©2015 www.12301.cc All Rights Reserved. 票付通信息科技有限公司 版权所有</span><br><span>经营许可证编号：闽B2-20150031</span><br />';
$h_config[$default]['att']='<span>联系地址：福建省福州市鼓楼区西二环218号伯爵大酒店6楼</span></br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<span>福建省福州市鼓楼区软件大道软件园B区23栋</span>&nbsp;&nbsp;&nbsp;</br><span>闽ICP备13015733号</span>'; 

$coop1='paypiao.12301.cc';
$h_config[$coop1]['name']='票务通';
$h_config[$coop1]['logo']='/images/index_coop1.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='029-86691134';
$h_config[$coop1]['host']='www.paypiao.cn';
$h_config[$coop1]['addr']='<span>©2013 www.paypiao.cn All Rights Reserved.  陕西精彩传媒有限公司 </span><br />
        <span>联系地址：西安市雁塔区融鑫路3号</span>&nbsp;&nbsp;&nbsp;<span>陕ICP备13000073号-2</span>';

/*这里开始复制*/		
$coop1='syyry.12301.cc';
$h_config[$coop1]['name']='逍遥游';
$h_config[$coop1]['logo']='/images/index_coop2.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='400-866-8166';
$h_config[$coop1]['host']='www.syyry.net';
$h_config[$coop1]['addr']='<span>版权所有：海南航空国际旅行社有限公司 </span><br />
        <span>地址：海南省海口市龙华区华信路5号华信大厦20楼 邮编：570208<br />
联系电话：400-866-8166  琼ICP备12000789号-4 技术支持：票付通团队</span>';
/*这里结束复制*/	

/*这里开始复制*/		
$coop1='dtdc.12301.cc';
$h_config[$coop1]['name']='观澜科技';
$h_config[$coop1]['logo']='/images/index_coop3.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='400-023-0008';
$h_config[$coop1]['host']='fxxt.dtdc.org.cn';
$h_config[$coop1]['addr']='<span>版权所有：重庆观澜科技有限公司</span><br />
        <span>地址：重庆市渝中区长江二路77-1号  传真：023-86897630<br />
联系电话：400-023-0008  渝ICP备10015718号-1 技术支持：票付通团队</span>';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='freeu.12301.cc';
$h_config[$coop1]['name']='桂林瑞泽';
$h_config[$coop1]['logo']='/images/index_coop4.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='';
$h_config[$coop1]['host']='www.freeu.cn';
$h_config[$coop1]['addr']='<span>版权所有：桂林瑞泽通信技术有限公司</span><br />
        <span>
《中华人民共和国电信与信息服务业务经营许可证》编号：桂ICP备12007638号-2 技术支持：票付通团队</span>';
/*这里结束复制*/
		
/*这里开始复制*/		
$coop1='smf.12301.cc';
$h_config[$coop1]['name']='北京水魔方';
$h_config[$coop1]['logo']='/images/index_coop5.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='010-51666619';
$h_config[$coop1]['host']='smf.12301.cc';
$h_config[$coop1]['addr']='<span>版权所有：北京欢乐水魔方水上乐园</span><br />
        <span>地址：北京市丰台区小屯路11号  服务热线：010-51666619 <br />
技术支持：票付通团队</span>';
/*这里结束复制*/
	

	
/*这里开始复制*/		
$coop1='trfenxiao.12301.cc';
$h_config[$coop1]['name']='天润分销';
$h_config[$coop1]['logo']='/images/index_coop6.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='010-51666846';
$h_config[$coop1]['host']='www.trfenxiao.com';
$h_config[$coop1]['addr']='<span>版权所有：北京天润嘉和酒店管理有限公司</span><br />
        <span>地址：北京市朝阳区东苇路金盏郁金香花园  服务热线：010-51666846 <br />
技术支持：票付通团队</span>';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='hubei.12301.cc';
$h_config[$coop1]['name']='湖北旅游';
$h_config[$coop1]['logo']='/images/index_coop7.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='027-85653866';
$h_config[$coop1]['host']='hubei.12301.cc';
$h_config[$coop1]['addr']='<span>版权所有：湖北旅游局</span><br />
        <span>地址:湖北省武汉市武昌区中北路98号（湖北旅游局）</br>
        武汉职业技术学院逸云楼511室 （旅游信息化协同创新实验室）</br>
 服务热线：027-85653866 <br />
技术支持：票付通团队</span>';
/*这里结束复制*/


/*这里开始复制*/		
$coop1='jqzj.12301.cc';
// $h_config[$coop1]['name']='济南欢乐假期';
$h_config[$coop1]['name']='景区之家门票分销平台';
$h_config[$coop1]['logo']='/images/index_coop8.jpg';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='0531-85861618 1508882233';
$h_config[$coop1]['host']='jqzj.12301.cc';
$h_config[$coop1]['addr']='<span>版权所有：山东景区之家门票分销平台</span><br />
        <span>地址:济南市天桥区三孔桥街盛世名门5-2-2101室</br>
	技术支持：票付通团队</span>';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='yyxpiao.12301.cc';
$h_config[$coop1]['name']='白水洋鸳鸯溪';
$h_config[$coop1]['logo']='/images/index_coop9.jpg';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='18105906489';
$h_config[$coop1]['host']='mp.yyx.com.cn';
$h_config[$coop1]['addr']='
<span>运营支撑：福州市览持网络科技有限公司</span><br />
<span>版权所有：福建圣阳白水洋旅游集团 地址:福建省屏南县圣阳新城</span>
<span></br>
	闽ICP备11012689号
    分销联系电话：18105906489   QQ：1971880608
</span>';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='k.12301.cc';
$h_config[$coop1]['name']='先行网';
$h_config[$coop1]['logo']='/images/index_coop10.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='400-858-1616';
$h_config[$coop1]['host']='k.16u.com';
$h_config[$coop1]['addr']='
<span>Copyright 2011 16u.com Corporation，先行网 版权所有 福建省旅游局 |福建省旅游信息中心</span><br />
<span>《中华人民共和国电信与信息服务业务经营许可证》编号：闽ICP证B2-20110075号闽ICP备11023138</span>
';
/*这里结束复制*/


/*这里开始复制*/		
$coop1='huangshan.12301.cc';
$h_config[$coop1]['name']='黄山驴网';
$h_config[$coop1]['logo']='/images/index_coop11.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='0559-5567657';
$h_config[$coop1]['host']='huangshan.12301.cc';
$h_config[$coop1]['addr']='
<span>运营支撑：票付通团队</span><br />
<span>版权所有：黄山驴网信息咨询服务有限公司 地址:安徽省黄山市黄山区汤口镇黄山风景区南大门
</span>
<span>
';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='hjzl.12301.cc';
$h_config[$coop1]['name']='红金之旅电子票务系统';
$h_config[$coop1]['logo']='/images/index_coop12.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='18624599703';
$h_config[$coop1]['host']='hjzl.12301.cc';
$h_config[$coop1]['addr']='
<span>运营品牌：红金之旅</span> <br />
<span>运营商/版权所有：辽宁红金旅游投资开发股份有限公司 </br>
 联系地址:辽宁营口鲅鱼圈御景湾六栋101
</span>
<span></br>
编号：鲁ICP14010336
</span>
';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='douqu.12301.cc';
$h_config[$coop1]['name']='都去旅行';
$h_config[$coop1]['logo']='/images/index_coop13.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='';
$h_config[$coop1]['host']='www.douqu.com';
$h_config[$coop1]['addr']='
<span>运营支撑：票付通团队</span> <br />
<span>版权所有：广州都去网络技术有限公司 </br>

</span>
<span>
';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='okpiao.12301.cc';
$h_config[$coop1]['name']='行万里电子商务';
$h_config[$coop1]['logo']='/images/index_coop144.jpg';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='07308988868';
$h_config[$coop1]['host']='okpiao.com.cn';
$h_config[$coop1]['addr']='
<span>运营支撑：票付通团队</span> <br />
<span>版权所有：湖南行万里电子商务有限公司 </br>
<span>备案号:湘ICP备14016579号-1</span>

</span>
<span>
';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='8youu.12301.cc';
$h_config[$coop1]['name']='山东国商旅行社有限公司';
$h_config[$coop1]['logo']='/images/index_coop15.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='0531-82312558';
$h_config[$coop1]['host']='8youu.12301.cc';
$h_config[$coop1]['addr']='
<span>运营支撑：票付通团队</span> <br />
<span>版权所有：山东国商旅行社有限公司  </br>
联系地址：济南市历城区花园路220号林华大厦707 
</span>
<span>
';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='ideamov.12301.cc';
$h_config[$coop1]['name']='艾迪互动';
$h_config[$coop1]['logo']='/images/index_coop16.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='400-99-22301';
$h_config[$coop1]['host']='ideamov.12301.cc';
$h_config[$coop1]['addr']='
<span>运营支撑：艾迪互动</span> <br />

 
</span>
<span>
';
/*这里结束复制*/

/*这里开始复制*/		
$coop1='yyd.12301.cc';
$h_config[$coop1]['name']='云顶';
$h_config[$coop1]['logo']='/images/index_logo_yunding.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='010-51666619';
$h_config[$coop1]['host']='yyd.12301.cc';
$h_config[$coop1]['addr']='<span>版权所有@ 2012-2013 易达(福建)旅游集团有限公司</span><br />
        <span>未经许可不得转载 闽ICP备11014225号 运营支撑：票付通团队</span>';
/*这里结束复制*/

///*这里开始复制*/
$coop1='xpchong.12301.cc';
$h_config[$coop1]['name']='小票虫票务平台';
$h_config[$coop1]['logo']='/new/d/shops/images/124073/14235393126300.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='0535-6217771';
$h_config[$coop1]['host']='www.xpchong.com';
$h_config[$coop1]['addr']='
<span>
联系地址：山东省烟台市芝罘区市长大厦
</span>
<span>
';
/*这里结束复制*/

///*这里开始复制*/
$coop1='bhgjl.12301.cc';
$h_config[$coop1]['name']='百合国际旅行社';
$h_config[$coop1]['logo']='/new/d/shops/images/511479/14328704501469.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='0335-4053811';
$h_config[$coop1]['host']='www.qhdmp.com';
$h_config[$coop1]['addr']='
<span>

</span>
<span>
';
/*这里结束复制*/

///*这里开始复制*/
$coop1='clhlpw.12301.cc';
$h_config[$coop1]['name']='鸿利旅游服务有限公司';
$h_config[$coop1]['logo']='http://www.12301.cc/shops/images/124481/14340939921928.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='17703353922';
$h_config[$coop1]['host']='www.clhlpw.com';
$h_config[$coop1]['addr']='
<span>

</span>
<span>
';
/*这里结束复制*/


///*这里开始复制*/
$coop1='haiyuan.12301.cc';
$h_config[$coop1]['name']='秦皇岛海源国际旅行社';
$h_config[$coop1]['logo']='http://www.12301.cc/shops/images/124385/14364248293022.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='18833828001  '; 
$h_config[$coop1]['host']='www.haiyuan.pw';
$h_config[$coop1]['addr']='
<span>
地址：秦皇岛市北戴河区保二路24号  联系电话:0335-8915888
</span>
<span>
';
/*这里结束复制*/


///*这里开始复制*/
$coop1='haopiao.12301.cc';
$h_config[$coop1]['name']='好票网';
$h_config[$coop1]['logo']='http://www.12301.cc/images/fenxiaoshang/haopiao1111.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='0379-61113833 '; 
$h_config[$coop1]['host']='www.haopiaowang.net';
$h_config[$coop1]['addr']='
<span>
联系qq：2797359087</br>
联系地址:洛阳市西工区王城大道与九都路交叉口申泰新世纪7-2504室
</span>
<span>
';  
/*这里结束复制*/
///*这里开始复制*/
$coop1='517232.12301.cc';
$h_config[$coop1]['name']='先行旅游供销平台';
$h_config[$coop1]['logo']='http://www.12301.cc/shops/images/517232/14418706958210.gif';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='4008581616 3115791698';
$h_config[$coop1]['host']='www.16u.com';
$h_config[$coop1]['addr']='
<span>
联系地址：福州市鼓楼区西二环中路218号伯爵酒店6楼
</span>
<span>
';
/*这里结束复制*/
///*这里开始复制*/
$coop1='123666.12301.cc';
$h_config[$coop1]['name']='旅游供销平台';
$h_config[$coop1]['logo']='http://www.12301.cc/shops/images/123666/14410713081485.png';
$h_config[$coop1]['navi']=0;
$h_config[$coop1]['tel']='4008581616 3115791698';
$h_config[$coop1]['host']='www.16u.cc';
$h_config[$coop1]['addr']='
<span>
联系地址：福州市鼓楼区西二环中路218号伯爵酒店6楼
</span>
<span>
';
/*这里结束复制*/







//$host = str_replace('http://', '', $_SERVER['HTTP_HOST']);
//$server_name = ;
if (!isset($h_config[$_SERVER['SERVER_NAME']])) {
    $cnt_dot = substr_count($_SERVER['HTTP_HOST'],'.');
    $isSubDomain = false;
    if ($cnt_dot==2) {
        if ( strpos($_SERVER['HTTP_HOST'], 'www') ===false
            && strpos($_SERVER['HTTP_HOST'], 'dev') ===false
            && strpos($_SERVER['HTTP_HOST'], '12301.cc')!==false ) {
            $isSubDomain = true;
        }
    }
    elseif ($cnt_dot==3) {
        $isSubDomain = true;
    }
    if ($isSubDomain) {
        if (!isset($redis)) {
            $redis = new Redis();
            $redis->connect('10.169.9.198', 6379);
            $redis->auth('myPft!12301!&');
        }
//二级域名处理
//step1:获取供应商账号，再获取id
        $host = str_replace('www.', '', $_SERVER['HTTP_HOST']);
        $applyAccount = substr($host, 0, strpos($host, '.12301'));
        $redis_key = "shop_{$applyAccount}";
        $shop = $redis->get($redis_key);
//        $redis->delete($redis_key);
//var_dump($shop);
        if (!$shop) {
            if (!class_exists('go_sql')) {
                include_once('/var/www/html/new/conf/le.je');
                $le = new go_sql();
                $le->connect();
            }
            //step2:根据账号查询该供应商二级域名的配置
            $sql = <<<SQL
SELECT `fid`,`M_domain`, `M_name`, `M_logo1`, `M_logo2`, `M_banner`,
`M_banner_url`, `M_navi`, `M_qq`, `M_tel`, `M_host`,`M_addr`
FROM pft_member_domain_info WHERE M_domain='{$applyAccount}' OR M_account_domain='{$applyAccount}' LIMIT 1
SQL;
            $GLOBALS['le']->query($sql);
            $shop = $GLOBALS['le']->fetch_assoc();
            if ($shop) {
                $redis->setex($redis_key, 1800, serialize($shop));
            }
            else {
                exit('404');
            }
        }
        else {
            $shop = unserialize($shop);
        }

        $_SESSION['is_sub_domain'] = $shop['fid'];

        $h_config[$_SERVER['SERVER_NAME']]['name']= $shop['M_name'];
        $h_config[$_SERVER['SERVER_NAME']]['logo']= $shop['M_logo1'];
        $h_config[$_SERVER['SERVER_NAME']]['navi']= 0;
        $h_config[$_SERVER['SERVER_NAME']]['tel'] = $shop['M_tel'] .'&nbsp;&nbsp;&nbsp;'. $shop['M_qq'];
        $h_config[$_SERVER['SERVER_NAME']]['host']= ($shop['M_host'])? $shop['M_host']:$shop['M_domain'].'.12301.cc';
        $h_config[$_SERVER['SERVER_NAME']]['addr']= $shop['M_addr'];
    }
}

?>
